﻿<%@ Page Title="" Language="C#" MasterPageFile="~/FilStartUps.Master" AutoEventWireup="true"
    CodeBehind="NewThread.aspx.cs" Inherits="FilStartUps.NewThread" %>

<%@ Register Src="Controls/FilStartUps_PageNav.ascx" TagName="FilStartUps_PageNav"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainNav" runat="server">
    <uc1:FilStartUps_PageNav ID="FilStartUps_PageNav1" runat="server" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="BodyHolder" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <script type="text/javascript">

        function checkEditorNotEmpty(source, args) {
            var editor = $find("<%=txtmessage.ClientID%>");
            var cont = editor.get_text();
            var isValid = cont.length > 0;
            args.IsValid = isValid;
        }
    </script>
    <asp:CustomValidator CssClass="errorMessage" ID="HtmlEditorValidator" runat="server"
        ErrorMessage="Release Note cannot be empty" Display="None" ControlToValidate="txtmessage"
        EnableClientScript="true" ClientValidationFunction="checkEditorNotEmpty" OnServerValidate="CheckEditorNotEmptyServerSide"
        ValidateEmptyText="true">
    </asp:CustomValidator>
    <span id="result"></span>
    <asp:Label runat="server" ID="lbcreate">Create New Thread</asp:Label>
    <div>
        <table border="1">
            <tr>
                <td>
                    <asp:Label runat="server" ID="lbtitle">Title:</asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Title is required!"
                        Display="Dynamic" Font-Size="Small" ControlToValidate="txttitle" ForeColor="Red"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txttitle"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label runat="server" ID="lbmessage">Message:</asp:Label><asp:RequiredFieldValidator
                        ID="RequiredFieldValidator2" runat="server" ErrorMessage="Message is required"
                        ControlToValidate="txtmessage" Display="Dynamic" Font-Size="Small" ForeColor="Red"></asp:RequiredFieldValidator>
                </td>
                <td>
                    <ajaxToolkit:HtmlEditorExtender runat="server" ID="htmleditor" TargetControlID="txtmessage">
                    </ajaxToolkit:HtmlEditorExtender>
                    <asp:TextBox runat="server" TextMode="MultiLine" ID="txtmessage" Height="150px" Width="400px"></asp:TextBox>
                </td>
            </tr>
        </table>
        <br />
        <br />
        <asp:Button runat="server" ID="btnsubmit" Text="Submit New Thread" OnClick="btnsubmit_Click" />
    </div>
    <br />
    <br />
</asp:Content>
